<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 3. 导入bootstrap的js文件 -->

    <link href="${pageContext.request.contextPath}//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
          rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
    <%--<!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->--%>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
    <title>Title</title>
    <style>
        td, th {
            text-align: center;
        }

        #form tr:hover {
            background-color: #f5f5f5;
        }

        *, html, body {
            background-color: rgb(246, 246, 246);
        }

        .logintext {
            height: 30px;
            clear: left;
            clear: right;
            font-size: 14px;
            float: right;
        }

    </style>
    <script>
        function delectBlogBiaoQian(id) {
            // alert(id);
            //用户安全提示
            if (confirm("您确定要删除吗？")) {
                //访问路径
                location.href = "${pageContext.request.contextPath}/jiqi/delete?id=" + id;
            }
        }

    </script>
</head>
<body>
<div>
    <h3 style="text-align: center">产品与机器的工序/加工时间对照表</h3>
    <a class="btn btn-warning pull-right" style="background: red" href="${pageContext.request.contextPath}/relation/delete" id="delSelectedAll">删除所有数据</a>
    <form id="form" action="#" method="post">
        <table border="1" class="table table-bordered table-hover ">
            <tr class="success">

                <th>编号</th>
                <th>产品ID</th>
                <th>工序号</th>
                <th>机器ID</th>
                <th>加工时间/分</th>
                <th>操作</th>
            </tr>
            <tbody>
            <c:forEach items="${sessionScope.listTable}" var="t" varStatus="s">
                <tr>


                    <td>${t.id}</td>
                    <td>${t.chanpin_id}</td>
                    <td>${t.gongxuhao}</td>
                    <td>${t.jiqi_id}</td>
                    <td>${t.time}</td>
                    <td>
                        <a class="btn btn-success btn-sm"
                           href="${pageContext.request.contextPath}/relation/deleteone?id=${t.id}">删除
                        </a>&nbsp;
                    </td>

                </tr>

            </c:forEach>
            </tbody>

        </table>
    </form>
    <div style="clear:right;float: left">
        <form class="form-inline" action="${pageContext.request.contextPath}/relation/insert"
              method="post">
            <div class="form-group">
                <label for="exampleInputName2">添加编号:</label>
                <input type="text" name="id" class="form-control" id="exampleInputName2">
            </div>

            <div class="form-group">
                <label for="exampleInputName3">添加产品ID:</label>
                <input type="text" name="chanpin_id" class="form-control" id="exampleInputName3">
            </div>

            <div class="form-group">
                <label for="exampleInputName4">添加工序号:</label>
                <input type="text" name="gongxuhao" class="form-control" id="exampleInputName4">
            </div>
            <div class="form-group">
                <label for="exampleInputName5">机器的ID:</label>
                <input type="text" name="jiqi_id" class="form-control" id="exampleInputName6>
            </div>
            <div class="form-group">
                <label for="exampleInputName3">加工时间/分:</label>
                <input type="text" name="time" class="form-control" id="exampleInputName5">
            </div>


            <button type="submit" class="btn btn-success">添加</button>
            <div style="clear:right;float: right;margin-right: 5px">
                <a class="btn btn-primary" href="${pageContext.request.contextPath}/suanfa/to">工件加工</a>
            </div>
        </form>
    </div>

</div>
</body>
</html>
